create database tb
on
(
name='tb',
filename='E:\test\Demo4.mdf',
size=5,
maxsize=50,
filegrowth=10%
)
log on
(
name='tb_log',
filename='E:\test\Demo4_log.mdf',
size=5,
maxsize=50,
filegrowth=10%
)
use tb
go
create table userinfo
(
userid int primary key identity(1,1),
username nvarchar(10) not null ,
usertel varchar(20) not null unique
)
create table HouseType
(
typeId int primary key identity(1,1),
typName nvarchar(10) not null
)
create table QX
(
qxId int primary key identity(1,1),
qxName nvarchar(10) not null
)
create table HouseInfo
(
id int primary key identity(1,1),
housedesc text,
userid int references userinfo(userid),
zj nvarchar(20) not null,
shi int not null,
ting int not null,
typeId int references HouseType(typeId),
qxId int references QX(qxId)
)